<div class="row">
	<div class="col-lg-12">
		<h1 class="page-header">Quản lý tài khoản</h1>
	</div>
	<!-- /.col-lg-12 -->
    <div class="col-lg-12">
        <p class="lead">
            <a href="<?php echo site_url('add-user');?>">
            <button type="button" class="btn btn-success btn-circle btn-lg">
                <i class="fa fa-plus"></i>
            </button> 
            Thêm tài khoản mới</a>
        </p>
	</div>
	
</div>

<div class="row">
    <div class="col-lg-12">
        <div class="panel panel-default">
            <div class="panel-heading">
                Danh sách tài khoản
            </div>
            <!-- /.panel-heading -->
            <div class="panel-body">
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover">
                        <thead>
                            <tr>
                                <th>#</th>
                                <th>Username</th>
                                <th>Fullname</th>
                                <th>Tên hiển thị</th>
                                <th>Email</th>
                                <th>mobile</th>
                                <th>Phân quyền</th>
                                <th colspan="2" style="text-align:center">Tác vụ</th>
                            </tr>
                        </thead>
                        <tbody>
                        <?php if($page_current != 0){
                            	   $page_current = $page_current - 1;
                            	}
                                 
                                $i = 1;
                                
                                foreach($data AS $key => $value):
                                $stt = $page_current * $_per_page + $i;?>
                            <tr>
                                <td><?php echo $stt;?></td>
                                <td><?php echo $value->username?></td>
                                <td><?php echo $value->fullname?></td>
                                <td><?php echo $value->display_name?></td>
                                <td><?php echo $value->email?></td>
                                <td><?php echo $value->mobile?></td>
                                <td>
                                    <?php if($value->level == 2):?>
                                        Nhân viên
                                    <?php elseif($value->level == 1):?>
                                        Quản lý
                                    <?php endif;?>
                                </td>
                                <td><a href="<?php echo $baseurl.'edit-user/'.$value->id?>">Sửa</a></td>
                                <td><a href="<?php echo $baseurl.'delete-user/'.$value->id?>">Xóa</a></td>
                            </tr>
                        <?php $i++; endforeach;?>
                        </tbody>
                    </table>
                </div>
                <!-- /.table-responsive -->
                
                <div class="pagination">
                    <?php echo $this->pagination->create_links();?>
                </div>
            </div>
            <!-- /.panel-body -->
        </div>
        <!-- /.panel -->
    </div>
    <!-- /.col-lg-12 -->
</div>

<style type="text/css">
    .pagination strong,
    .pagination a{
        display: inline-block;
        padding: 5px 9px;
        margin: 0 5px;
    }
    .pagination a{
        cursor: pointer;
        border: 1px solid #337ab7;
    }
    .pagination strong{
        border: 1px solid #535353;
        background-color: #fafafa;
    }
</style>